home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’95 / Closure / Sources / PhotoshopHeaders / PIExport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-24  |  5.2 KB  |  151 lines  |  [TEXT/MPS ]

  1. /*
  2.     File: PIExport.h
  3.  
  4.     Copyright 1990-91 by Thomas Knoll.    Copyright 1992-95 by Adobe Systems, Inc..
  5.     All rights reserved.
  6.  
  7.     This file describes version 4.0 of Photoshop's Export module interface.
  8. */
  9.  
  10. #ifndef __PIExport__
  11. #define __PIExport__
  12.  
  13. #include "PIGeneral.h"
  14.  
  15. /* Operation selectors */
  16.  
  17. #define exportSelectorAbout    0
  18. #define exportSelectorStart    1
  19. #define exportSelectorContinue 2
  20. #define exportSelectorFinish   3
  21. #define exportSelectorPrepare  4
  22.  
  23. /* Error return values. The plug-in module may also return standard Macintosh
  24.    operating system error codes, or report its own errors, in which case it
  25.    can return any positive integer. */
  26.  
  27. #define exportBadParameters -30200    /* "a problem with the export module interface" */
  28. #define exportBadMode        -30201    /* "the export module does not support <mode> images" */
  29.  
  30. /******************************************************************************/
  31. /* Pragma to byte align structures; only for Borland C */
  32.  
  33. #if defined(__BORLANDC__)
  34. #pragma option -a-
  35. #endif
  36.  
  37. /******************************************************************************/
  38. #if defined(__PPCC__)
  39. #pragma options align=mac68k
  40. #endif
  41. typedef struct ExportRecord
  42.     {
  43.  
  44.     int32            serialNumber;    /* Host's serial number, to allow
  45.                                        copy protected plug-in modules. */
  46.  
  47.     TestAbortProc    abortProc;        /* The plug-in module may call this no-argument
  48.                                        BOOLEAN function (using Pascal calling
  49.                                        conventions) several times a second during long
  50.                                        operations to allow the user to abort the operation.
  51.                                        If it returns TRUE, the operation should be aborted
  52.                                        (and a positive error code returned). */
  53.  
  54.     ProgressProc    progressProc;    /* The plug-in module may call this two-argument
  55.                                        procedure periodically to update a progress
  56.                                        indicator.  The first parameter is the number
  57.                                        of operations completed; the second is the total
  58.                                        number of operations. */
  59.  
  60.     int32            maxData;        /* Maximum number of bytes that should be
  61.                                        requested at once (the plug-in should reduce
  62.                                        its requests by the size any large buffers
  63.                                        it allocates). The plug-in may reduce this
  64.                                        value in the exportSelectorPrepare routine. */
  65.  
  66.     int16            imageMode;        /* Image mode */
  67.     Point            imageSize;        /* Size of image */
  68.     int16            depth;            /* Bits per sample, currently will be 1 or 8 */
  69.     int16            planes;         /* Samples per pixel */
  70.  
  71.     Fixed            imageHRes;        /* Pixels per inch */
  72.     Fixed            imageVRes;        /* Pixels per inch */
  73.  
  74.     LookUpTable        redLUT;         /* Red LUT, only used for Indexed Color images */
  75.     LookUpTable        greenLUT;        /* Green LUT, only used for Indexed Color images */
  76.     LookUpTable        blueLUT;        /* Blue LUT, only used for Indexed Color images */
  77.  
  78.     Rect            theRect;        /* Rectangle requested, set to empty rect when done */
  79.     int16            loPlane;        /* First plane requested */
  80.     int16            hiPlane;        /* Last plane requested */
  81.  
  82.     void *            data;            /* A pointer to the requested image data */
  83.     int32            rowBytes;        /* Spacing between rows */
  84.  
  85.     Str255             filename;        /* Document file name */
  86.     int16            vRefNum;        /* Volume reference number, or zero if none */
  87.     Boolean         dirty;            /* Changes since last saved flag. The plug-in may clear
  88.                                        this field to prevent prompting the user when
  89.                                        closing the document. */
  90.  
  91.     Rect            selectBBox;     /* Bounding box of current selection, or an empty
  92.                                        rect if there is no current selection. */
  93.  
  94.     OSType            hostSig;        /* Creator code for host application */
  95.     HostProc        hostProc;        /* Host specific callback procedure */
  96.  
  97.     Handle            duotoneInfo;    /* Handle to duotone information. */
  98.  
  99.     int16            thePlane;        /* Currently selected channel,
  100.                                        or -1 if a composite color channel,
  101.                                        or -2 if all channels. */
  102.  
  103.     PlugInMonitor    monitor;        /* Information on current monitor */
  104.  
  105.     void *            platformData;    /* Platform specific hook. */
  106.  
  107.     BufferProcs *    bufferProcs;    /* Host buffer maintenance procedures. */
  108.     
  109.     ResourceProcs *    resourceProcs;    /* Host plug-in resource procedures. */
  110.     
  111.     ProcessEventProc processEvent;    /* Pass events to the application. */
  112.     
  113.     DisplayPixelsProc displayPixels;/* Display dithered pixels. */
  114.  
  115.     HandleProcs        *handleProcs;    /* Platform independent handle manipulation. */
  116.  
  117.     ColorServicesProc colorServices; /* Routine to access color services. */
  118.     
  119.     GetPropertyProc    getProperty;    /* A routine to query for document and
  120.                                        view properties.  This is not in a
  121.                                        suite because we allow getting but not
  122.                                        setting properties in filters.  The
  123.                                        plug-in needs to dispose of the handle
  124.                                        it is returned using the handle suite. */
  125.                                        
  126.     AdvanceStateProc advanceState;    /* Allowed from Start and Continue. */
  127.     
  128.     int16            layerPlanes;
  129.     int16            transparencyMask;
  130.     int16            layerMasks;
  131.     int16            invertedLayerMasks;
  132.     int16            nonLayerPlanes;
  133.                                        
  134.     char            reserved [210]; /* Set to zero */
  135.  
  136.     }
  137. ExportRecord, *ExportRecordPtr;
  138. #if defined(__PPCC__)
  139. #pragma options align=reset
  140. #endif
  141. /******************************************************************************/
  142. /* turn off the byte align pragma back to its original state; only for Borland C */
  143.  
  144. #if defined(__BORLANDC__)
  145. #pragma option -a.
  146. #endif
  147.  
  148. /******************************************************************************/
  149.  
  150. #endif
  151.